/*
 * @Author: 李小晴 2689279066@qq.com
 * @Date: 2023-03-16 10:34:03
 * @LastEditors: 李小晴 2689279066@qq.com
 * @LastEditTime: 2023-09-05 15:54:24
 * @FilePath: \sys\src\api\cs\classTag\index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { useAxios } from '@/hooks/web/useAxios'
import type { TableData } from './types'
const request = useAxios()

import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()

// 分类与标签列表
export const adminCsClassTagListApi = (data: any) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsClassTagList',
      data: data
    }
  })
}

// 分类与标签修改
export const adminCsClassTagEditApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsClassTagEdit',
      data: data
    }
  })
}

// 分类与标签新增
export const adminCsClassTagAddApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsClassTagAdd',
      data: data
    }
  })
}

// 分类与标签删除
export const adminCsClassTagDelApi = (data: TableData) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsClassTagDel',
      data: data
    }
  })
}

// 分类与标签批量删除
export const adminCsClassTagBatchDelApi = (data: { ids: string }) => {
  return request.post({
    url: 'index.php/api/common',
    headers: { token: wsCache.get('token') },
    data: {
      code: 'adminCsClassTagBatchDel',
      data: data
    }
  })
}
